﻿#region Using directives

using System;
using System.Data;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;

using PAT.Entities;
using PAT.Data;

#endregion

namespace PAT.Data.Bases
{	
	///<summary>
	/// This class is the base class for any <see cref="PatCitaTallerProviderBase"/> implementation.
	/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
	///</summary>
	public abstract partial class PatCitaTallerProviderBaseCore : EntityProviderBase<PAT.Entities.PatCitaTaller, PAT.Entities.PatCitaTallerKey>
	{		
		#region Get from Many To Many Relationship Functions
		#endregion	
		
		#region Delete Methods

		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="transactionManager">A <see cref="TransactionManager"/> object.</param>
		/// <param name="key">The unique identifier of the row to delete.</param>
		/// <returns>Returns true if operation suceeded.</returns>
		public override bool Delete(TransactionManager transactionManager, PAT.Entities.PatCitaTallerKey key)
		{
			return Delete(transactionManager, key.IdCita);
		}
		
		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="_idCita">. Primary Key.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		public bool Delete(System.Int32 _idCita)
		{
			return Delete(null, _idCita);
		}
		
		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idCita">. Primary Key.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		public abstract bool Delete(TransactionManager transactionManager, System.Int32 _idCita);		
		
		#endregion Delete Methods
		
		#region Get By Foreign Key Functions
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_CATALOGO_VEHICULO key.
		///		FK_PAT_CITA_TALLER_PAT_CATALOGO_VEHICULO Description: 
		/// </summary>
		/// <param name="_idCatalogo"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public TList<PatCitaTaller> GetByIdCatalogo(System.Int32 _idCatalogo)
		{
			int count = -1;
			return GetByIdCatalogo(_idCatalogo, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_CATALOGO_VEHICULO key.
		///		FK_PAT_CITA_TALLER_PAT_CATALOGO_VEHICULO Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idCatalogo"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		/// <remarks></remarks>
		public TList<PatCitaTaller> GetByIdCatalogo(TransactionManager transactionManager, System.Int32 _idCatalogo)
		{
			int count = -1;
			return GetByIdCatalogo(transactionManager, _idCatalogo, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_CATALOGO_VEHICULO key.
		///		FK_PAT_CITA_TALLER_PAT_CATALOGO_VEHICULO Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idCatalogo"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public TList<PatCitaTaller> GetByIdCatalogo(TransactionManager transactionManager, System.Int32 _idCatalogo, int start, int pageLength)
		{
			int count = -1;
			return GetByIdCatalogo(transactionManager, _idCatalogo, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_CATALOGO_VEHICULO key.
		///		fkPatCitaTallerPatCatalogoVehiculo Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idCatalogo"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public TList<PatCitaTaller> GetByIdCatalogo(System.Int32 _idCatalogo, int start, int pageLength)
		{
			int count =  -1;
			return GetByIdCatalogo(null, _idCatalogo, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_CATALOGO_VEHICULO key.
		///		fkPatCitaTallerPatCatalogoVehiculo Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idCatalogo"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public TList<PatCitaTaller> GetByIdCatalogo(System.Int32 _idCatalogo, int start, int pageLength,out int count)
		{
			return GetByIdCatalogo(null, _idCatalogo, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_CATALOGO_VEHICULO key.
		///		FK_PAT_CITA_TALLER_PAT_CATALOGO_VEHICULO Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idCatalogo"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public abstract TList<PatCitaTaller> GetByIdCatalogo(TransactionManager transactionManager, System.Int32 _idCatalogo, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_EMPLEADO key.
		///		FK_PAT_CITA_TALLER_PAT_EMPLEADO Description: 
		/// </summary>
		/// <param name="_idRecepcionistaAsignado"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public TList<PatCitaTaller> GetByIdRecepcionistaAsignado(System.Int32 _idRecepcionistaAsignado)
		{
			int count = -1;
			return GetByIdRecepcionistaAsignado(_idRecepcionistaAsignado, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_EMPLEADO key.
		///		FK_PAT_CITA_TALLER_PAT_EMPLEADO Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idRecepcionistaAsignado"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		/// <remarks></remarks>
		public TList<PatCitaTaller> GetByIdRecepcionistaAsignado(TransactionManager transactionManager, System.Int32 _idRecepcionistaAsignado)
		{
			int count = -1;
			return GetByIdRecepcionistaAsignado(transactionManager, _idRecepcionistaAsignado, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_EMPLEADO key.
		///		FK_PAT_CITA_TALLER_PAT_EMPLEADO Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idRecepcionistaAsignado"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public TList<PatCitaTaller> GetByIdRecepcionistaAsignado(TransactionManager transactionManager, System.Int32 _idRecepcionistaAsignado, int start, int pageLength)
		{
			int count = -1;
			return GetByIdRecepcionistaAsignado(transactionManager, _idRecepcionistaAsignado, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_EMPLEADO key.
		///		fkPatCitaTallerPatEmpleado Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idRecepcionistaAsignado"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public TList<PatCitaTaller> GetByIdRecepcionistaAsignado(System.Int32 _idRecepcionistaAsignado, int start, int pageLength)
		{
			int count =  -1;
			return GetByIdRecepcionistaAsignado(null, _idRecepcionistaAsignado, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_EMPLEADO key.
		///		fkPatCitaTallerPatEmpleado Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idRecepcionistaAsignado"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public TList<PatCitaTaller> GetByIdRecepcionistaAsignado(System.Int32 _idRecepcionistaAsignado, int start, int pageLength,out int count)
		{
			return GetByIdRecepcionistaAsignado(null, _idRecepcionistaAsignado, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_EMPLEADO key.
		///		FK_PAT_CITA_TALLER_PAT_EMPLEADO Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idRecepcionistaAsignado"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public abstract TList<PatCitaTaller> GetByIdRecepcionistaAsignado(TransactionManager transactionManager, System.Int32 _idRecepcionistaAsignado, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_ESTADO_CITA key.
		///		FK_PAT_CITA_TALLER_PAT_ESTADO_CITA Description: 
		/// </summary>
		/// <param name="_idEstadoCita"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public TList<PatCitaTaller> GetByIdEstadoCita(System.Byte _idEstadoCita)
		{
			int count = -1;
			return GetByIdEstadoCita(_idEstadoCita, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_ESTADO_CITA key.
		///		FK_PAT_CITA_TALLER_PAT_ESTADO_CITA Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idEstadoCita"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		/// <remarks></remarks>
		public TList<PatCitaTaller> GetByIdEstadoCita(TransactionManager transactionManager, System.Byte _idEstadoCita)
		{
			int count = -1;
			return GetByIdEstadoCita(transactionManager, _idEstadoCita, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_ESTADO_CITA key.
		///		FK_PAT_CITA_TALLER_PAT_ESTADO_CITA Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idEstadoCita"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public TList<PatCitaTaller> GetByIdEstadoCita(TransactionManager transactionManager, System.Byte _idEstadoCita, int start, int pageLength)
		{
			int count = -1;
			return GetByIdEstadoCita(transactionManager, _idEstadoCita, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_ESTADO_CITA key.
		///		fkPatCitaTallerPatEstadoCita Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idEstadoCita"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public TList<PatCitaTaller> GetByIdEstadoCita(System.Byte _idEstadoCita, int start, int pageLength)
		{
			int count =  -1;
			return GetByIdEstadoCita(null, _idEstadoCita, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_ESTADO_CITA key.
		///		fkPatCitaTallerPatEstadoCita Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idEstadoCita"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public TList<PatCitaTaller> GetByIdEstadoCita(System.Byte _idEstadoCita, int start, int pageLength,out int count)
		{
			return GetByIdEstadoCita(null, _idEstadoCita, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_ESTADO_CITA key.
		///		FK_PAT_CITA_TALLER_PAT_ESTADO_CITA Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idEstadoCita"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public abstract TList<PatCitaTaller> GetByIdEstadoCita(TransactionManager transactionManager, System.Byte _idEstadoCita, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_KIT key.
		///		FK_PAT_CITA_TALLER_PAT_KIT Description: 
		/// </summary>
		/// <param name="_idKit"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public TList<PatCitaTaller> GetByIdKit(System.Int32? _idKit)
		{
			int count = -1;
			return GetByIdKit(_idKit, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_KIT key.
		///		FK_PAT_CITA_TALLER_PAT_KIT Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idKit"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		/// <remarks></remarks>
		public TList<PatCitaTaller> GetByIdKit(TransactionManager transactionManager, System.Int32? _idKit)
		{
			int count = -1;
			return GetByIdKit(transactionManager, _idKit, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_KIT key.
		///		FK_PAT_CITA_TALLER_PAT_KIT Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idKit"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public TList<PatCitaTaller> GetByIdKit(TransactionManager transactionManager, System.Int32? _idKit, int start, int pageLength)
		{
			int count = -1;
			return GetByIdKit(transactionManager, _idKit, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_KIT key.
		///		fkPatCitaTallerPatKit Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idKit"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public TList<PatCitaTaller> GetByIdKit(System.Int32? _idKit, int start, int pageLength)
		{
			int count =  -1;
			return GetByIdKit(null, _idKit, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_KIT key.
		///		fkPatCitaTallerPatKit Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idKit"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public TList<PatCitaTaller> GetByIdKit(System.Int32? _idKit, int start, int pageLength,out int count)
		{
			return GetByIdKit(null, _idKit, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_KIT key.
		///		FK_PAT_CITA_TALLER_PAT_KIT Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idKit"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public abstract TList<PatCitaTaller> GetByIdKit(TransactionManager transactionManager, System.Int32? _idKit, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_TALLER key.
		///		FK_PAT_CITA_TALLER_PAT_TALLER Description: 
		/// </summary>
		/// <param name="_idTaller"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public TList<PatCitaTaller> GetByIdTaller(System.Int32 _idTaller)
		{
			int count = -1;
			return GetByIdTaller(_idTaller, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_TALLER key.
		///		FK_PAT_CITA_TALLER_PAT_TALLER Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idTaller"></param>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		/// <remarks></remarks>
		public TList<PatCitaTaller> GetByIdTaller(TransactionManager transactionManager, System.Int32 _idTaller)
		{
			int count = -1;
			return GetByIdTaller(transactionManager, _idTaller, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_TALLER key.
		///		FK_PAT_CITA_TALLER_PAT_TALLER Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idTaller"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public TList<PatCitaTaller> GetByIdTaller(TransactionManager transactionManager, System.Int32 _idTaller, int start, int pageLength)
		{
			int count = -1;
			return GetByIdTaller(transactionManager, _idTaller, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_TALLER key.
		///		fkPatCitaTallerPatTaller Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idTaller"></param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public TList<PatCitaTaller> GetByIdTaller(System.Int32 _idTaller, int start, int pageLength)
		{
			int count =  -1;
			return GetByIdTaller(null, _idTaller, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_TALLER key.
		///		fkPatCitaTallerPatTaller Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_idTaller"></param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public TList<PatCitaTaller> GetByIdTaller(System.Int32 _idTaller, int start, int pageLength,out int count)
		{
			return GetByIdTaller(null, _idTaller, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_PAT_CITA_TALLER_PAT_TALLER key.
		///		FK_PAT_CITA_TALLER_PAT_TALLER Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idTaller"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of PAT.Entities.PatCitaTaller objects.</returns>
		public abstract TList<PatCitaTaller> GetByIdTaller(TransactionManager transactionManager, System.Int32 _idTaller, int start, int pageLength, out int count);
		
		#endregion

		#region Get By Index Functions
		
		/// <summary>
		/// 	Gets a row from the DataSource based on its primary key.
		/// </summary>
		/// <param name="transactionManager">A <see cref="TransactionManager"/> object.</param>
		/// <param name="key">The unique identifier of the row to retrieve.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <returns>Returns an instance of the Entity class.</returns>
		public override PAT.Entities.PatCitaTaller Get(TransactionManager transactionManager, PAT.Entities.PatCitaTallerKey key, int start, int pageLength)
		{
			return GetByIdCita(transactionManager, key.IdCita, start, pageLength);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key PK_PAT_CITA_TALLER index.
		/// </summary>
		/// <param name="_idCita"></param>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatCitaTaller"/> class.</returns>
		public PAT.Entities.PatCitaTaller GetByIdCita(System.Int32 _idCita)
		{
			int count = -1;
			return GetByIdCita(null,_idCita, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_PAT_CITA_TALLER index.
		/// </summary>
		/// <param name="_idCita"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatCitaTaller"/> class.</returns>
		public PAT.Entities.PatCitaTaller GetByIdCita(System.Int32 _idCita, int start, int pageLength)
		{
			int count = -1;
			return GetByIdCita(null, _idCita, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_PAT_CITA_TALLER index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idCita"></param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatCitaTaller"/> class.</returns>
		public PAT.Entities.PatCitaTaller GetByIdCita(TransactionManager transactionManager, System.Int32 _idCita)
		{
			int count = -1;
			return GetByIdCita(transactionManager, _idCita, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_PAT_CITA_TALLER index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idCita"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatCitaTaller"/> class.</returns>
		public PAT.Entities.PatCitaTaller GetByIdCita(TransactionManager transactionManager, System.Int32 _idCita, int start, int pageLength)
		{
			int count = -1;
			return GetByIdCita(transactionManager, _idCita, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_PAT_CITA_TALLER index.
		/// </summary>
		/// <param name="_idCita"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatCitaTaller"/> class.</returns>
		public PAT.Entities.PatCitaTaller GetByIdCita(System.Int32 _idCita, int start, int pageLength, out int count)
		{
			return GetByIdCita(null, _idCita, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_PAT_CITA_TALLER index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_idCita"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="PAT.Entities.PatCitaTaller"/> class.</returns>
		public abstract PAT.Entities.PatCitaTaller GetByIdCita(TransactionManager transactionManager, System.Int32 _idCita, int start, int pageLength, out int count);
						
		#endregion "Get By Index Functions"
	
		#region Custom Methods
		
		
		#endregion

		#region Helper Functions	
		
		/// <summary>
		/// Fill a TList&lt;PatCitaTaller&gt; From a DataReader.
		/// </summary>
		/// <param name="reader">Datareader</param>
		/// <param name="rows">The collection to fill</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">number of rows.</param>
		/// <returns>a <see cref="TList&lt;PatCitaTaller&gt;"/></returns>
		public static TList<PatCitaTaller> Fill(IDataReader reader, TList<PatCitaTaller> rows, int start, int pageLength)
		{
			NetTiersProvider currentProvider = DataRepository.Provider;
            bool useEntityFactory = currentProvider.UseEntityFactory;
            bool enableEntityTracking = currentProvider.EnableEntityTracking;
            LoadPolicy currentLoadPolicy = currentProvider.CurrentLoadPolicy;
			Type entityCreationFactoryType = currentProvider.EntityCreationalFactoryType;
			
			// advance to the starting row
			for (int i = 0; i < start; i++)
			{
				if (!reader.Read())
				return rows; // not enough rows, just return
			}
			for (int i = 0; i < pageLength; i++)
			{
				if (!reader.Read())
					break; // we are done
					
				string key = null;
				
				PAT.Entities.PatCitaTaller c = null;
				if (useEntityFactory)
				{
					key = new System.Text.StringBuilder("PatCitaTaller")
					.Append("|").Append((System.Int32)reader[((int)PatCitaTallerColumn.IdCita - 1)]).ToString();
					c = EntityManager.LocateOrCreate<PatCitaTaller>(
					key.ToString(), // EntityTrackingKey
					"PatCitaTaller",  //Creational Type
					entityCreationFactoryType,  //Factory used to create entity
					enableEntityTracking); // Track this entity?
				}
				else
				{
					c = new PAT.Entities.PatCitaTaller();
				}
				
				if (!enableEntityTracking ||
					c.EntityState == EntityState.Added ||
					(enableEntityTracking &&
					
						(
							(currentLoadPolicy == LoadPolicy.PreserveChanges && c.EntityState == EntityState.Unchanged) ||
							(currentLoadPolicy == LoadPolicy.DiscardChanges && c.EntityState != EntityState.Unchanged)
						)
					))
				{
					c.SuppressEntityEvents = true;
					c.IdCita = (System.Int32)reader[((int)PatCitaTallerColumn.IdCita - 1)];
					c.IdTaller = (System.Int32)reader[((int)PatCitaTallerColumn.IdTaller - 1)];
					c.FechaCita = (System.DateTime)reader[((int)PatCitaTallerColumn.FechaCita - 1)];
					c.HoraCita = (System.DateTime)reader[((int)PatCitaTallerColumn.HoraCita - 1)];
					c.IdRecepcionistaAsignado = (System.Int32)reader[((int)PatCitaTallerColumn.IdRecepcionistaAsignado - 1)];
					c.IdCatalogo = (System.Int32)reader[((int)PatCitaTallerColumn.IdCatalogo - 1)];
					c.PlacaVehiculo = (System.String)reader[((int)PatCitaTallerColumn.PlacaVehiculo - 1)];
					c.NombreCliente = (System.String)reader[((int)PatCitaTallerColumn.NombreCliente - 1)];
					c.TelefonoFijoCliente = (System.String)reader[((int)PatCitaTallerColumn.TelefonoFijoCliente - 1)];
					c.TelefonoMovilCliente = (System.String)reader[((int)PatCitaTallerColumn.TelefonoMovilCliente - 1)];
					c.EMailCliente = (System.String)reader[((int)PatCitaTallerColumn.EMailCliente - 1)];
					c.IdKit = (reader.IsDBNull(((int)PatCitaTallerColumn.IdKit - 1)))?null:(System.Int32?)reader[((int)PatCitaTallerColumn.IdKit - 1)];
					c.IdEstadoCita = (System.Byte)reader[((int)PatCitaTallerColumn.IdEstadoCita - 1)];
					c.Observaciones = (System.String)reader[((int)PatCitaTallerColumn.Observaciones - 1)];
					c.Activo = (System.Boolean)reader[((int)PatCitaTallerColumn.Activo - 1)];
					c.EntityTrackingKey = key;
					c.AcceptChanges();
					c.SuppressEntityEvents = false;
				}
				rows.Add(c);
			}
		return rows;
		}		
		/// <summary>
		/// Refreshes the <see cref="PAT.Entities.PatCitaTaller"/> object from the <see cref="IDataReader"/>.
		/// </summary>
		/// <param name="reader">The <see cref="IDataReader"/> to read from.</param>
		/// <param name="entity">The <see cref="PAT.Entities.PatCitaTaller"/> object to refresh.</param>
		public static void RefreshEntity(IDataReader reader, PAT.Entities.PatCitaTaller entity)
		{
			if (!reader.Read()) return;
			
			entity.IdCita = (System.Int32)reader[((int)PatCitaTallerColumn.IdCita - 1)];
			entity.IdTaller = (System.Int32)reader[((int)PatCitaTallerColumn.IdTaller - 1)];
			entity.FechaCita = (System.DateTime)reader[((int)PatCitaTallerColumn.FechaCita - 1)];
			entity.HoraCita = (System.DateTime)reader[((int)PatCitaTallerColumn.HoraCita - 1)];
			entity.IdRecepcionistaAsignado = (System.Int32)reader[((int)PatCitaTallerColumn.IdRecepcionistaAsignado - 1)];
			entity.IdCatalogo = (System.Int32)reader[((int)PatCitaTallerColumn.IdCatalogo - 1)];
			entity.PlacaVehiculo = (System.String)reader[((int)PatCitaTallerColumn.PlacaVehiculo - 1)];
			entity.NombreCliente = (System.String)reader[((int)PatCitaTallerColumn.NombreCliente - 1)];
			entity.TelefonoFijoCliente = (System.String)reader[((int)PatCitaTallerColumn.TelefonoFijoCliente - 1)];
			entity.TelefonoMovilCliente = (System.String)reader[((int)PatCitaTallerColumn.TelefonoMovilCliente - 1)];
			entity.EMailCliente = (System.String)reader[((int)PatCitaTallerColumn.EMailCliente - 1)];
			entity.IdKit = (reader.IsDBNull(((int)PatCitaTallerColumn.IdKit - 1)))?null:(System.Int32?)reader[((int)PatCitaTallerColumn.IdKit - 1)];
			entity.IdEstadoCita = (System.Byte)reader[((int)PatCitaTallerColumn.IdEstadoCita - 1)];
			entity.Observaciones = (System.String)reader[((int)PatCitaTallerColumn.Observaciones - 1)];
			entity.Activo = (System.Boolean)reader[((int)PatCitaTallerColumn.Activo - 1)];
			entity.AcceptChanges();
		}
		
		/// <summary>
		/// Refreshes the <see cref="PAT.Entities.PatCitaTaller"/> object from the <see cref="DataSet"/>.
		/// </summary>
		/// <param name="dataSet">The <see cref="DataSet"/> to read from.</param>
		/// <param name="entity">The <see cref="PAT.Entities.PatCitaTaller"/> object.</param>
		public static void RefreshEntity(DataSet dataSet, PAT.Entities.PatCitaTaller entity)
		{
			DataRow dataRow = dataSet.Tables[0].Rows[0];
			
			entity.IdCita = (System.Int32)dataRow["ID_CITA"];
			entity.IdTaller = (System.Int32)dataRow["ID_TALLER"];
			entity.FechaCita = (System.DateTime)dataRow["FECHA_CITA"];
			entity.HoraCita = (System.DateTime)dataRow["HORA_CITA"];
			entity.IdRecepcionistaAsignado = (System.Int32)dataRow["ID_RECEPCIONISTA_ASIGNADO"];
			entity.IdCatalogo = (System.Int32)dataRow["ID_CATALOGO"];
			entity.PlacaVehiculo = (System.String)dataRow["PLACA_VEHICULO"];
			entity.NombreCliente = (System.String)dataRow["NOMBRE_CLIENTE"];
			entity.TelefonoFijoCliente = (System.String)dataRow["TELEFONO_FIJO_CLIENTE"];
			entity.TelefonoMovilCliente = (System.String)dataRow["TELEFONO_MOVIL_CLIENTE"];
			entity.EMailCliente = (System.String)dataRow["E_MAIL_CLIENTE"];
			entity.IdKit = Convert.IsDBNull(dataRow["ID_KIT"]) ? null : (System.Int32?)dataRow["ID_KIT"];
			entity.IdEstadoCita = (System.Byte)dataRow["ID_ESTADO_CITA"];
			entity.Observaciones = (System.String)dataRow["OBSERVACIONES"];
			entity.Activo = (System.Boolean)dataRow["ACTIVO"];
			entity.AcceptChanges();
		}
		#endregion 
		
		#region DeepLoad Methods
		/// <summary>
		/// Deep Loads the <see cref="IEntity"/> object with criteria based of the child 
		/// property collections only N Levels Deep based on the <see cref="DeepLoadType"/>.
		/// </summary>
		/// <remarks>
		/// Use this method with caution as it is possible to DeepLoad with Recursion and traverse an entire object graph.
		/// </remarks>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">The <see cref="PAT.Entities.PatCitaTaller"/> object to load.</param>
		/// <param name="deep">Boolean. A flag that indicates whether to recursively save all Property Collection that are descendants of this instance. If True, saves the complete object graph below this object. If False, saves this object only. </param>
		/// <param name="deepLoadType">DeepLoadType Enumeration to Include/Exclude object property collections from Load.</param>
		/// <param name="childTypes">PAT.Entities.PatCitaTaller Property Collection Type Array To Include or Exclude from Load</param>
		/// <param name="innerList">A collection of child types for easy access.</param>
	    /// <exception cref="ArgumentNullException">entity or childTypes is null.</exception>
	    /// <exception cref="ArgumentException">deepLoadType has invalid value.</exception>
		public override void DeepLoad(TransactionManager transactionManager, PAT.Entities.PatCitaTaller entity, bool deep, DeepLoadType deepLoadType, System.Type[] childTypes, DeepSession innerList)
		{
			if(entity == null)
				return;

			#region IdCatalogoSource	
			if (CanDeepLoad(entity, "PatCatalogoVehiculo|IdCatalogoSource", deepLoadType, innerList) 
				&& entity.IdCatalogoSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.IdCatalogo;
				PatCatalogoVehiculo tmpEntity = EntityManager.LocateEntity<PatCatalogoVehiculo>(EntityLocator.ConstructKeyFromPkItems(typeof(PatCatalogoVehiculo), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.IdCatalogoSource = tmpEntity;
				else
					entity.IdCatalogoSource = DataRepository.PatCatalogoVehiculoProvider.GetByIdCatalogo(transactionManager, entity.IdCatalogo);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdCatalogoSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdCatalogoSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.PatCatalogoVehiculoProvider.DeepLoad(transactionManager, entity.IdCatalogoSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion IdCatalogoSource

			#region IdRecepcionistaAsignadoSource	
			if (CanDeepLoad(entity, "PatEmpleado|IdRecepcionistaAsignadoSource", deepLoadType, innerList) 
				&& entity.IdRecepcionistaAsignadoSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.IdRecepcionistaAsignado;
				PatEmpleado tmpEntity = EntityManager.LocateEntity<PatEmpleado>(EntityLocator.ConstructKeyFromPkItems(typeof(PatEmpleado), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.IdRecepcionistaAsignadoSource = tmpEntity;
				else
					entity.IdRecepcionistaAsignadoSource = DataRepository.PatEmpleadoProvider.GetByIdEmpleado(transactionManager, entity.IdRecepcionistaAsignado);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdRecepcionistaAsignadoSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdRecepcionistaAsignadoSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.PatEmpleadoProvider.DeepLoad(transactionManager, entity.IdRecepcionistaAsignadoSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion IdRecepcionistaAsignadoSource

			#region IdEstadoCitaSource	
			if (CanDeepLoad(entity, "PatEstadoCita|IdEstadoCitaSource", deepLoadType, innerList) 
				&& entity.IdEstadoCitaSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.IdEstadoCita;
				PatEstadoCita tmpEntity = EntityManager.LocateEntity<PatEstadoCita>(EntityLocator.ConstructKeyFromPkItems(typeof(PatEstadoCita), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.IdEstadoCitaSource = tmpEntity;
				else
					entity.IdEstadoCitaSource = DataRepository.PatEstadoCitaProvider.GetByIdEstadoCita(transactionManager, entity.IdEstadoCita);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdEstadoCitaSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdEstadoCitaSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.PatEstadoCitaProvider.DeepLoad(transactionManager, entity.IdEstadoCitaSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion IdEstadoCitaSource

			#region IdKitSource	
			if (CanDeepLoad(entity, "PatKit|IdKitSource", deepLoadType, innerList) 
				&& entity.IdKitSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.IdKit ?? (int)0);
				PatKit tmpEntity = EntityManager.LocateEntity<PatKit>(EntityLocator.ConstructKeyFromPkItems(typeof(PatKit), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.IdKitSource = tmpEntity;
				else
					entity.IdKitSource = DataRepository.PatKitProvider.GetByIdKit(transactionManager, (entity.IdKit ?? (int)0));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdKitSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdKitSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.PatKitProvider.DeepLoad(transactionManager, entity.IdKitSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion IdKitSource

			#region IdTallerSource	
			if (CanDeepLoad(entity, "PatTaller|IdTallerSource", deepLoadType, innerList) 
				&& entity.IdTallerSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.IdTaller;
				PatTaller tmpEntity = EntityManager.LocateEntity<PatTaller>(EntityLocator.ConstructKeyFromPkItems(typeof(PatTaller), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.IdTallerSource = tmpEntity;
				else
					entity.IdTallerSource = DataRepository.PatTallerProvider.GetByIdTaller(transactionManager, entity.IdTaller);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'IdTallerSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.IdTallerSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.PatTallerProvider.DeepLoad(transactionManager, entity.IdTallerSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion IdTallerSource
			
			//used to hold DeepLoad method delegates and fire after all the local children have been loaded.
			Dictionary<string, KeyValuePair<Delegate, object>> deepHandles = new Dictionary<string, KeyValuePair<Delegate, object>>();
			
			//Fire all DeepLoad Items
			foreach(KeyValuePair<Delegate, object> pair in deepHandles.Values)
		    {
                pair.Key.DynamicInvoke((object[])pair.Value);
		    }
			deepHandles = null;
		}
		
		#endregion 
		
		#region DeepSave Methods

		/// <summary>
		/// Deep Save the entire object graph of the PAT.Entities.PatCitaTaller object with criteria based of the child 
		/// Type property array and DeepSaveType.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="entity">PAT.Entities.PatCitaTaller instance</param>
		/// <param name="deepSaveType">DeepSaveType Enumeration to Include/Exclude object property collections from Save.</param>
		/// <param name="childTypes">PAT.Entities.PatCitaTaller Property Collection Type Array To Include or Exclude from Save</param>
		/// <param name="innerList">A Hashtable of child types for easy access.</param>
		public override bool DeepSave(TransactionManager transactionManager, PAT.Entities.PatCitaTaller entity, DeepSaveType deepSaveType, System.Type[] childTypes, DeepSession innerList)
		{	
			if (entity == null)
				return false;
							
			#region Composite Parent Properties
			//Save Source Composite Properties, however, don't call deep save on them.  
			//So they only get saved a single level deep.
			
			#region IdCatalogoSource
			if (CanDeepSave(entity, "PatCatalogoVehiculo|IdCatalogoSource", deepSaveType, innerList) 
				&& entity.IdCatalogoSource != null)
			{
				DataRepository.PatCatalogoVehiculoProvider.Save(transactionManager, entity.IdCatalogoSource);
				entity.IdCatalogo = entity.IdCatalogoSource.IdCatalogo;
			}
			#endregion 
			
			#region IdRecepcionistaAsignadoSource
			if (CanDeepSave(entity, "PatEmpleado|IdRecepcionistaAsignadoSource", deepSaveType, innerList) 
				&& entity.IdRecepcionistaAsignadoSource != null)
			{
				DataRepository.PatEmpleadoProvider.Save(transactionManager, entity.IdRecepcionistaAsignadoSource);
				entity.IdRecepcionistaAsignado = entity.IdRecepcionistaAsignadoSource.IdEmpleado;
			}
			#endregion 
			
			#region IdEstadoCitaSource
			if (CanDeepSave(entity, "PatEstadoCita|IdEstadoCitaSource", deepSaveType, innerList) 
				&& entity.IdEstadoCitaSource != null)
			{
				DataRepository.PatEstadoCitaProvider.Save(transactionManager, entity.IdEstadoCitaSource);
				entity.IdEstadoCita = entity.IdEstadoCitaSource.IdEstadoCita;
			}
			#endregion 
			
			#region IdKitSource
			if (CanDeepSave(entity, "PatKit|IdKitSource", deepSaveType, innerList) 
				&& entity.IdKitSource != null)
			{
				DataRepository.PatKitProvider.Save(transactionManager, entity.IdKitSource);
				entity.IdKit = entity.IdKitSource.IdKit;
			}
			#endregion 
			
			#region IdTallerSource
			if (CanDeepSave(entity, "PatTaller|IdTallerSource", deepSaveType, innerList) 
				&& entity.IdTallerSource != null)
			{
				DataRepository.PatTallerProvider.Save(transactionManager, entity.IdTallerSource);
				entity.IdTaller = entity.IdTallerSource.IdTaller;
			}
			#endregion 
			#endregion Composite Parent Properties

			// Save Root Entity through Provider
			if (!entity.IsDeleted)
				this.Save(transactionManager, entity);
			
			//used to hold DeepSave method delegates and fire after all the local children have been saved.
			Dictionary<string, KeyValuePair<Delegate, object>> deepHandles = new Dictionary<string, KeyValuePair<Delegate, object>>();
			//Fire all DeepSave Items
			foreach(KeyValuePair<Delegate, object> pair in deepHandles.Values)
		    {
                pair.Key.DynamicInvoke((object[])pair.Value);
		    }
			
			// Save Root Entity through Provider, if not already saved in delete mode
			if (entity.IsDeleted)
				this.Save(transactionManager, entity);
				

			deepHandles = null;
						
			return true;
		}
		#endregion
	} // end class
	
	#region PatCitaTallerChildEntityTypes
	
	///<summary>
	/// Enumeration used to expose the different child entity types 
	/// for child properties in <c>PAT.Entities.PatCitaTaller</c>
	///</summary>
	public enum PatCitaTallerChildEntityTypes
	{
		
		///<summary>
		/// Composite Property for <c>PatCatalogoVehiculo</c> at IdCatalogoSource
		///</summary>
		[ChildEntityType(typeof(PatCatalogoVehiculo))]
		PatCatalogoVehiculo,
			
		///<summary>
		/// Composite Property for <c>PatEmpleado</c> at IdRecepcionistaAsignadoSource
		///</summary>
		[ChildEntityType(typeof(PatEmpleado))]
		PatEmpleado,
			
		///<summary>
		/// Composite Property for <c>PatEstadoCita</c> at IdEstadoCitaSource
		///</summary>
		[ChildEntityType(typeof(PatEstadoCita))]
		PatEstadoCita,
			
		///<summary>
		/// Composite Property for <c>PatKit</c> at IdKitSource
		///</summary>
		[ChildEntityType(typeof(PatKit))]
		PatKit,
			
		///<summary>
		/// Composite Property for <c>PatTaller</c> at IdTallerSource
		///</summary>
		[ChildEntityType(typeof(PatTaller))]
		PatTaller,
		}
	
	#endregion PatCitaTallerChildEntityTypes
	
	#region PatCitaTallerFilterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;PatCitaTallerColumn&gt;"/> class
	/// that is used exclusively with a <see cref="PatCitaTaller"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class PatCitaTallerFilterBuilder : SqlFilterBuilder<PatCitaTallerColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the PatCitaTallerFilterBuilder class.
		/// </summary>
		public PatCitaTallerFilterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the PatCitaTallerFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public PatCitaTallerFilterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the PatCitaTallerFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public PatCitaTallerFilterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion PatCitaTallerFilterBuilder
	
	#region PatCitaTallerParameterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="ParameterizedSqlFilterBuilder&lt;PatCitaTallerColumn&gt;"/> class
	/// that is used exclusively with a <see cref="PatCitaTaller"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class PatCitaTallerParameterBuilder : ParameterizedSqlFilterBuilder<PatCitaTallerColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the PatCitaTallerParameterBuilder class.
		/// </summary>
		public PatCitaTallerParameterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the PatCitaTallerParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public PatCitaTallerParameterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the PatCitaTallerParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public PatCitaTallerParameterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion PatCitaTallerParameterBuilder
	
	#region PatCitaTallerSortBuilder
    
    /// <summary>
    /// A strongly-typed instance of the <see cref="SqlSortBuilder&lt;PatCitaTallerColumn&gt;"/> class
	/// that is used exclusively with a <see cref="PatCitaTaller"/> object.
    /// </summary>
    [CLSCompliant(true)]
    public class PatCitaTallerSortBuilder : SqlSortBuilder<PatCitaTallerColumn>
    {
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the PatCitaTallerSqlSortBuilder class.
		/// </summary>
		public PatCitaTallerSortBuilder() : base() { }

		#endregion Constructors

    }    
    #endregion PatCitaTallerSortBuilder
	
} // end namespace
